<?php
Yii::import('zii.widgets.CPortlet');

class NewsPortlet extends CPortlet {

    public function init() {
        $this->title = "Latest News";
        parent::init();
    }

    protected function renderContent() {
//        $criteria=new CDbCriteria(array(
//        'condition'=>'status='.News::expire_date,
//        'order'=>'update_time DESC',
//        'with'=>'commentCount',
//    ));
     
    $dataProvider = new CActiveDataProvider('News', array(
            'criteria' => array(
                'order' => 'create_date DESC',
            ),
        ));    
    //$dataProvider = new CActiveDataProvider('News');           
    //$dataProvider=new CActiveDataProvider('News', array('criteria'=>$criteria));
 
    $this->render('newsPortlet', array('data'=>$dataProvider));
    //    $this->render('newsPortlet');
    }

}

?>
